all:
	@echo "Write this Makefile by your self."

sim:
	$(call git_commit, "sim RTL") # DO NOT REMOVE THIS LINE!!!
	@echo "Write this Makefile by your self."

include ../Makefile

TOP_VERILOG_FILE = ./vsrc/top.v
TOP_MODULE_NAME = top

# Verilator flags
VR_FLAGS = --cc --trace 

# C++ compiler flags
CPP_FLAGS = -Wextra -Werror -std=c++11

# Build rules
all: top

top: 
	verilator --trace -cc vsrc/*.v --top-module top --exe csrc/top.cpp
	make -C obj_dir -f Vtop.mk Vtop -j6
#	g++ $(CPP_FLAGS) $^ -o $@ $(VR_LIBS)

Vtop.o: $(TOP_VERILOG_FILE)
#	verilator -Wall --trace -cc vsrc/top.v --exe csrc/top.cpp
#	verilator $(VR_FLAGS) --Mdir obj_dir $(TOP_VERILOG_FILE) --exe csrc/top.cpp
# $(MAKE) -C obj_dir/ -f Vtop.mk Vtop.o -j6

top.o:
#	g++ $(CPP_FLAGS) -c ./csrc/top.cpp

clean:
	rm -rf obj_dir top.o Vtop.o top *.vcd